<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="div">
        {{name}}
        <!--全称写法 v-on:click="send()"   -->
        <button @click="send()">发起请求</button>
    </div>
    
</body>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    new Vue({
        el:"#div",
        data:{
            name:"张三",
            age:18
        },
        methods:{
            send(){
                //1.发送异步请求
                /*
                    说明：
                        1.后台url的地址   "http://localhost:8080/axiosDemo01Servlet"
                */
               axios.get("http://localhost:8080/axiosDemo01Servlet")
               .then((resp)=>{
                console.log("后台收到数据了！！！！")
               })
            
            }
        }
    });
</script>



</html>